Rebased D2Common.dll Readme
===========================

With the release of v1.10 a new problem has arisen to befuddle programmers.  D2Game was substantially enlarged,
but Blizzard never bothered to check the base loading addresses of the DLLs to sniff out conflicts.  Unfortunately
this means D2Common cannot load at its preferred address of 6FD40000.  Windows will load the DLL but it can appear
at just about any address.  Normally this isn't a problem because Blizzard uses exported functions and import tables
to communicate between DLLs.  Advanced code techniques with custom DLLs are vulnerable, however.

When a DLL relocates, all of the absolute address references are edited in the memory image by Windows.  These
addresses are called "fixups" because Windows has to "fix" them with new absolute addresses for the program session.
The fixup table sits at the end of the DLL.  If additional code is added, and addresses are absolutely referenced,
then some method of fixing the new addresses is required, BEFORE the game tries to use your new code.  You can either
do this dynamically by patching the instructions in-game, or statically by editing the fixup table.  Neither solution
is ideal. The first method requires a potentially dangerous Windows API call to remove the barriers between code
sections that Windows enforces (the source of the infamous c0000005 Access Violation), and it must be done every game.
The second method requires tedious review of absolute addresses and hex editing the fixup table and a couple of places
in the PE header, but at least it is required only once.

Blizzard assigned unusual preferred loading addresses for their DLLs.  It is an unusual setup indeed that forces a
relocation of any DLL except the new D2Common.  This copy of D2Common has been rebased to have a preferred loading
address of 6F600000 (affecting all absolute references), and is unchanged from the Blizzard original in every other
way.  (The new address was chosen to be compatible with D2Extra.dll, which must load at 6F700000.)  It even runs fine
on open Battle.net; I never test changes on Realms, but theoretically it would not be significant.  Therefore it makes
the game more stable in memory and substantially lowers the risk of unexpected relocation should you not want to hassle
with the fixup table or in-game patching.

Myhrginoc
11/17/2003